<?php
namespace app\index\model;
use think\Model;
class User extends Model
{
  public function addRecharge($data,$id)
  {
    $code = $this->find($id);
    $num = $code['integral']+$data['integral'];
    $data['integral'] = $num;
    $res = $this->allowField(true)->save($data,['id'=>$id]);
    return $res;
  }
}
?>